#pragma once

namespace BWAPI {
	class Game;
	class Player;
	class Position;
	class Unit;

	namespace Managed {
		ref class AIModule;
	}
}

class AIModuleWrapper : public BWAPI::AIModule {
	private:
		gcroot<BWAPI::Managed::AIModule ^> m_AIModule;
		bool m_GameStarted;
	public:
		AIModuleWrapper(BWAPI::Game *Game);
		virtual ~AIModuleWrapper(void);
		virtual void onStart(void);
		virtual void onEnd(bool IsWinner);
		virtual void onFrame(void);
		virtual bool onSendText(std::string Text);
		virtual void onPlayerLeft(BWAPI::Player *Player);
		virtual void onNukeDetect(BWAPI::Position Target);
		virtual void onUnitCreate(BWAPI::Unit *Unit);
		virtual void onUnitDestroy(BWAPI::Unit *Unit);
		virtual void onUnitMorph(BWAPI::Unit *Unit);
		virtual void onUnitShow(BWAPI::Unit *Unit);
		virtual void onUnitHide(BWAPI::Unit *Unit);
		virtual void onUnitRenegade(BWAPI::Unit *Unit);
		
	private:
		void WriteLog(System::String ^Message);
		void WriteLog(System::String ^Message, ... array<System::Object ^> ^Params);
};